import sys
import os

ori_dir = sys.argv[1]

for dir in os.listdir(ori_dir):
	child = os.path.join(ori_dir, dir)
	if os.path.isdir(child):
		for f in os.listdir(child):
			ext = os.path.splitext(f)[1]
			if ext=='.jpg' or ext=='.jpeg' or ext=='.png':
				os.rename(os.path.join(child,f), os.path.join(child, dir+'-'+f))